package com.esp.feign.feignservice;

import com.esp.commentdemo.util.Result;
import com.esp.feign.feignservice.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Project:spring-boot-new-publish-system-12
 * ClassName:CommentFeginSercice
 * Package:com.esp.feign.feignservice.config
 * User:CWQ
 * Description:
 *
 * @Author 合肥-陈万琼
 * @Create 2024/5/31 23:49
 * @Version 1.0
 */
@FeignClient(name = "comment-demo",contextId = "comment-demo",configuration = FeignConfig.class)
public interface CommentFeginService {
    //新增评论
    @PostMapping("/admin/comments/add")
    @ResponseBody
    public void addComment(@RequestParam Long newsId,
                           @RequestParam String commentator,
                           @RequestParam String commentBody);
    //查询评论
    @GetMapping("/admin/comments/list")
    public Result list(@RequestParam Map<String, Object> params);
    //查评论内容
    @GetMapping("/admin/comments/content/{newsId}")
    public String getCommentCotent(@PathVariable Long newsId);
    //删除评论
    @PostMapping("/admin/comments/delete")
    public Result delete(@RequestBody Integer[] ids);
    //审核评论
    @PostMapping("/admin/comments/checkDone")
    @ResponseBody
    public Result checkDone(@RequestBody Integer[] ids);
}
